package com.eogo.item.web;

import com.eogo.item.pojo.Product;
import com.eogo.item.service.ProductService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("product")
public class ProductController {

    @Autowired
    private ProductService productService;

    @ApiOperation(value = "发布商品" , notes = "")
    @PostMapping("insertCategory")
    public ResponseEntity<Void> inserProduct(@ApiParam("分类实体对象") Product product){
        productService.inserProduct(product);
        return ResponseEntity.status(HttpStatus.OK).build();
    }
}
